<template>
	<view>
		<u-sticky bgColor="#6492FF" offsetTop=0 customNavHeight=0>
			<navbox title="设置"></navbox>
		</u-sticky>
		<view class="con">
			<view class="con__item" v-for="(item,index) in list" :key="index" @click="navto(item.url)">
				<view class="u-flex u-flex-y-center">
					<image :src="'/static/img/my/'+item.icon+'.png'" class="con__item__icon" mode=""></image>
					<view class="con__item__text">
						{{item.text}}
					</view>
				</view>
				<image src="/static/img/home/more.png" class="con__item__more" mode=""></image>
			</view>
			<view class="con__footer">
				<u-button text="退出登录" @click="loginout" color="#6492FF" shape='circle'></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[
					{text:'用户服务协议',icon:'xy',url:'/pages/my/webviewpage?title=用户服务协议&name=agreement',value:''},
					{text:'隐私政策',icon:'ys',url:'/pages/my/webviewpage?title=隐私政策&name=private',value:''},
					{text:'修改密码',icon:'mm',url:'/pages/index/editpassword',value:''},
					// {text:'当前版本',icon:'banben',url:'',value:''},
				]
			};
		},
		methods:{
			loginout(){
				uni.showModal({
					title:'确定退出登录？',
					success(r) {
						if(r.confirm){
							uni.removeStorageSync('ytbtoken')
							uni.removeStorageSync('ytbuser')
							uni.reLaunch({
								url:'/pages/index/login'
							})
							uni.setStorageSync('ytbhomepopstatus',true)
							uni.setStorageSync('ytbinfopopstatus',[])
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
page{
	background-color: #f6f6f6;
	
}
.con{
	padding: 25rpx 16rpx;
	&__item{
		margin-bottom: 26rpx;
		padding: 0 56rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		height: 73rpx;
		background: #FFFFFF;
		border-radius: 14rpx;
		font-family: Source Han Sans SC;
		font-weight: 400;
		font-size: 26rpx;
		color: #3E3D3D;
		line-height: 26rpx;
		
		&__icon{
			width: 38rpx;
			height: 38rpx;
			margin-right: 34rpx;
		}
		&__more{
			width: 21rpx;
			height: 28rpx;
		}
	}
	&__footer{
		padding: 0 100rpx;
	}
}
</style>
